package com.dayu.finecomm.handler.tpacket;

import com.dayu.finecomm.protocol.SpecialCareChannelInboundAdapter;
import com.dayu.finecomm.protocol.pojo.TPacket;
import com.dayu.opcua.UnitalkUaClient;

import io.netty.channel.ChannelHandlerContext;

public class TPacketOPCUAHandler extends SpecialCareChannelInboundAdapter<TPacket> {

	private UnitalkUaClient client;

	public TPacketOPCUAHandler(String endpoint) throws Exception {
		client = new UnitalkUaClient(endpoint);
	}

	@Override
	protected void channelRead0(ChannelHandlerContext arg0, TPacket packet) throws Exception {
		client.write(packet);
	}
}
